﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using System.Web.Routing;

namespace Shake.Framework.Infrastructure
{
    public class Feature : AreaRegistration, IFeature
    {
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                this.AreaName,
                this.AreaName + "/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }, // 不要写 controller = Home
                new string[]
                {
                    string.Format("{0}.Controllers", this.AreaName)
                });
        }

        public virtual string Name
        {
            get { return "framework"; }
        }

        public override string AreaName
        {
            get { return "framework"; }
        }
    }
}
